home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
asywiz
/
asmwiz.doc
< prev
next >
Wrap
Text File
|
1994-11-03
|
45KB
|
1,196 lines
The Assembly Wizard's Library page 1
Version 2.0
AsmWiz Copyright (c) 1990-1994 Thomas G. Hanlin III
This is AsmWiz, a library of assembly language routines for
assembly language programmers. It is copyrighted and may be
distributed only under the following conditions:
All AsmWiz files must be distributed together as a unit in
unmodified form. No files may be left out or added.
YOU USE THIS LIBRARY AT YOUR OWN RISK. I have tested it on my
own computer, but I will not assume responsibility for any
problems which AsmWiz may cause you.
It is expected that if you find AsmWiz useful, you will register
your copy. You may not use AsmWiz routines in programs intended
for distribution unless you have registered.
Registration gets you the latest version of AsmWiz, complete
with full source code. The source code is designed for the MASM
6.0 and may require modifications to work with other assemblers.
The AsmWiz library was designed for use with small assembly
programs and is compatible with the creation of COM files. All
CALLs are of the NEAR variety. A FAR model will be created if
there is sufficient interest.
For an example of how to set up your program to access the
AsmWiz library, how to LINK the routines, and so forth, see the
EXAMPLE.ASM, EXAMPLE.COM, and ?CREATE.BAT files. The file
PACKING.LST tells you which ?CREATE batch file to use with which
assembler. There are versions for A86, MASM, OPTASM, QuickASM,
and TASM.
Note that DOS-dependent services expect DOS 2.0 or higher
versions unless otherwise specified.
Table of Contents page 2
Overview and Legal Info ................................... 1
Base Conversions .......................................... 3
Exception Handling ........................................ 4
Delays and Countdowns ..................................... 5
File Handling ............................................. 6
Filename Manipulation ..................................... 8
Keyboard Services ......................................... 9
Long Integer Math ........................................ 10
Memory Services .......................................... 11
Mouse Services ........................................... 12
Sound and Music .......................................... 13
String Services .......................................... 14
Telecommunications ....................................... 16
Time and Date ............................................ 17
Video Services ........................................... 18
Miscellaneous Services ................................... 27
Error Codes .............................................. 28
Base Conversions page 3
The Base Conversion Services provide the ability to convert back
and forth between a number and its ASCIIZ representation. Any
base from 2-36 may be employed, so these routines encompass
binary, decimal, hex and octal conversions. Services are
provided for integers and long integers, both signed and
unsigned.
The following services are available:
BC_ASC2INT convert ASCIIZ string to unsigned integer
BL <-- base from which to convert
DS:SI <-- ptr to string
-------
AX = unsigned integer
BC_ASC2LONG convert ASCIIZ string to unsigned long int
BL <-- base from which to convert
DS:SI <-- ptr to string
-------
DX,AX = unsigned long integer
BC_ASC2SINT convert ASCIIZ string to signed integer
BL <-- base from which to convert
DS:SI <-- ptr to string
-------
AX = signed integer
BC_ASC2SLONG convert ASCIIZ string to signed long integer
BL <-- base from which to convert
DS:SI <-- ptr to string
-------
DX,AX = signed long integer
BC_INT2ASC convert unsigned integer to ASCIIZ string
AX <-- unsigned integer
BL <-- base to which to convert
ES:DI <-- ptr to string buffer (17 bytes)
BC_LONG2ASC convert unsigned long int to ASCIIZ string
DX,AX <-- unsigned long integer
BL <-- base to which to convert
ES:DI <-- ptr to string buffer (33 bytes)
BC_SINT2ASC convert signed integer to ASCIIZ string
AX <-- signed integer
BL <-- base to which to convert
ES:DI <-- ptr to string buffer (18 bytes)
BC_SLONG2ASC convert signed long integer to ASCIIZ string
DX,AX <-- signed long integer
BL <-- base to which to convert
ES:DI <-- ptr to string buffer (34 bytes)
Exception Handling page 4
The Exception Handling Services allow your program to take
control over exception conditions. This covers critical errors
and Control-Break / Control-C handling.
The critical error handler gives you the ability to recover from
critical errors, which would otherwise cause the infamous
"R>etry, I>gnore, F>ail, A>bort?" prompt.
The break handler allows your program to ignore the Control-C
and Control-Break keys or to process them in an orderly manner.
This is vital if you are using any of the AsmWiz services which
need to be shut down before the program terminates. Up to eight
procedures can be called when ^Break or ^C are used (they will
be ignored if you turn off ^Break / ^C).
The following services are available:
EH_INITCRIT initialize the critical error handler
EH_CRITERR check for a critical error
EH_CRITDONE terminates the critical error handler
EH_INITBREAK initialize the ^C / ^Break handler
EH_ADDBREAK add a procedure to be called on ^C / ^Break
DX <-- procedure offset (CS-relative)
EH_SETBREAK allow or ignore ^C and ^Break
AL <-- 0 to ignore, 1 to allow
EH_SUBBREAK remove a procedure to be called on ^C / ^Break
DX <-- procedure offset (CS-relative)
Delays and Countdowns page 5
The Delay Services are for those times when you want the
computer to sit around doing nothing for a while. Delays of
various timing resolution are available for anything from small
to large waits.
Notes on the 100th-second delay and countdown services:
Since MD_DONE must be called before the program terminates, you
should use the EH_ADDBREAK service to insure that MD_DONE is
called if Control-Break or Control-C are permitted to abort the
program.
Timers 0-1 may be used by AsmWiz itself for various services.
See ASMWIZ.MAN for more details on the 100th-second delay
services.
The following services are available:
MD_DELAY delay for a number of 100ths of seconds
CX <-- delay (0-32767)
MD_DONE terminate 100th-second delay handler
MD_GETTIMER get a delay count
AL <-- timer number (0-7)
-------
CX = delay * 2 (0-65534)
MD_INIT initialize 100th-second delay handler
MD_SETTIMER set a delay count
AL <-- timer number (0-7)
CX <-- delay (0-32767)
MD_TICK delay for a number of clock ticks (18ths of seconds)
CX <-- delay (0-65535)
File Handling page 6
The File Handling Services provide a comprehensive and powerful
set of routines for file handling. The usual open file,
read/write, file pointer manipulation, and close file operations